package com.shg.web.ztest;


import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.shg.bean.Roles;
import com.shg.service.RolesService;

public class RolesServiceTest {

	static RolesService rolesService;
	
	@BeforeClass
	public static void setUpBeforeClass() throws Exception {
		ApplicationContext context=new ClassPathXmlApplicationContext("basics-application.xml");
		rolesService = (RolesService) context.getBean("rolesServiceBean");
	}

	@Test
	public void testInsert() {
		Roles entity=new Roles();
		entity.setName("超级管理员");
		entity.setRemarks("超级管理员拥有最好的管理权限");
		rolesService.insert(entity);
	}
	
	@Test
	public void testAddPower(){
		try {
			rolesService.addPower(new Integer[]{47}, 82);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

}
